package com.eastfair.saga.proxy;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * OrderService
 *
 * @author dmego
 * @date 2021/3/31 10:48
 */
//@FeignClient(value = "auth")
//@RequestMapping("/order")
public interface OrderService {

    /**
     * 开始创建订单
     * @param orderId
     * @param userId
     * @param productId
     * @param amount
     * @param count
     * @return
     * @throws Exception
     */
//    @RequestMapping("/createOrder")
    Boolean createOrder(@RequestParam("orderId") Long orderId,
                        @RequestParam("userId") Long userId,
                        @RequestParam("productId") Long productId,
                        @RequestParam("amount") Integer amount,
                        @RequestParam("count") Integer count) throws Exception;

    /**
     * 开始撤销订单
     * @param orderId
     * @return
     * @throws Exception
     */
//    @RequestMapping("/revokeOrder")
    Boolean revokeOrder(@RequestParam("orderId") Long orderId) throws Exception;
}
